package mskruch.gps.matching;

import mskruch.gps.Point;
import mskruch.gps.Position;

/**
 * Can be used to check if one track (source) contains the other (pattern).
 * 
 * @author Marcin Skruch
 */
public interface TrackFinder {
    /**
     * If the first and the last position in patter are the same then the round
     * track is implied.
     * 
     * @param pattern
     *            the pattern to be searched for
     */
    public void setPattern(Position[] pattern);

    /**
     * @param source
     *            the source to be searched in
     */
    public void setSource(Point[] source);

    /**
     * @return next subset of points from source which is considered to be the
     *         same track as the pattern or <code>null</code> if there are no
     *         more matches
     */
    public Point[] next();
}
